<template>
  <ant-modal
    modalWidth="1000"
    modalHeight="800"
    :visible="open"
    :modal-title="formTitle"
    :adjust-size="true"
    @cancel="cancel"
  >
    <a-form-model
      ref="form"
      :model="form"
      :rules="rules"
      slot="content"
      layout="vertical"
    >
      <a-row :gutter="32" style="width: 96%; margin-left: 2%">
        <a-col :span="12">
          <a-form-model-item label="来源">
            <a-transfer
              :data-source="laiyuanData"
              :list-style="{
                width: '150px',
                height: '300px',
              }"
              :titles="['待选', '选中']"
              :target-keys="targetLaiyuanKeys"
              :render="(item) => `${item.title}`"
              @change="handleChangeLaiyuan"
            >
              <span slot="notFoundContent"> 暂无数据 </span>
            </a-transfer>
          </a-form-model-item>
        </a-col>
        <a-col :span="12">
          <a-form-model-item label="城市">
            <a-transfer
              :data-source="cityData"
              :list-style="{
                width: '150px',
                height: '300px',
              }"
              :titles="['待选', '选中']"
              :target-keys="targetCityKeys"
              :render="(item) => `${item.title}`"
              @change="handleChangeCity"
            >
              <span slot="notFoundContent"> 暂无数据 </span>
            </a-transfer>
          </a-form-model-item>
        </a-col>
      </a-row>

      <a-row :gutter="32" style="width: 96%; margin-left: 2%">
        <a-col :span="10">
          <a-form-model-item
            label="默认单价（元/条）"
            :label-col="{ span: 8 }"
            :wrapper-col="{ span: 16 }"
          >
            <a-input-number
              v-model="defaultPrice"
              :min="0"
              :max="10000"
              style="width: 100%"
              @change="onChangePrice"
            />
          </a-form-model-item>
        </a-col>
      </a-row>
      <a-row :gutter="32" style="width: 96%; margin-left: 1%">
        <a-col :span="24">
          <a-table
            rowKey="rowid"
            size="middle"
            :columns="columns"
            :data-source="tableData"
            :scroll="{ x: 'calc(200px + 50%)' }"
            bordered
            :pagination="false"
          >
            <span slot="amount" slot-scope="text, record">
              <a-input-number
                v-model="record.amount"
                :min="0"
                :max="10000"
                placeholder="1-10000"
                :precision="0"
                allow-clear
                style="width: 80%"
              />
            </span>
            <span slot="remark" slot-scope="text, record">
              <a-input v-model="record.remark" allow-clear style="width: 80%" />
            </span>
          </a-table>
        </a-col>
      </a-row>
    </a-form-model>
    <template slot="footer">
      <a-button @click="cancel"> 取消 </a-button>
      <a-button type="primary" @click="submitTransferForm"> 保存 </a-button>
    </template>
  </ant-modal>
</template>
<script>
import BizXiansuoChengbenAddForm from "./BizXiansuoChengbenForm";
export default {
  ...BizXiansuoChengbenAddForm,
};
</script>
